package com.cm.entity.lic.element;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

/**
 * 元素父类
 * 定义元素基本内容
 */
@Data
@ApiModel("元素数据实体")
public class Element {

    @NotNull( message = "元素ID不得为空")
    @ApiModelProperty("元素ID")
    private Integer id;

    @NotNull( message = "元素所属页面ID不得为空")
    @ApiModelProperty("所属页面ID")
    private Integer pageId;

    @NotNull( message = "元素所属页面下图层不得为空")
    @ApiModelProperty("所属图层")
    private Integer layerId;

    @NotNull
    @Length(min = 1, message = "元素宽度不得小于1")
    @ApiModelProperty("元素宽度")
    private Double width;

    @NotNull
    @Length(min = 1, message = "元素高度不得小于1")
    @ApiModelProperty("元素高度")
    private Double height;

    @NotNull
    @Length(min = 0, message = "元素margin不得小于0")
    private Double marginX;

    @NotNull
    @Length(min = 0, message = "元素margin不得小于0")
    private Double marginY;

    @NotNull
    @Length(min = 0, message = "元素padding不得小于0")
    private Double paddingX;

    @NotNull
    @Length(min = 0, message = "元素padding不得小于0")
    private Double paddingY;

    @NotNull
    @Length(min = 0, message = "元素border不得小于0")
    private Double borderX;

    @NotNull
    @Length(min = 0, message = "元素border不得小于0")
    private Double borderY;

}
